package com.huawei.appmarket.service.settings.card;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;
import android.view.View;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appgallery.serverreqkit.api.listener.IServerCallBack;
import com.huawei.appmarket.service.appdetail.bean.report.GeneralResponse;
import com.huawei.appmarket.service.appdetail.bean.report.GeneralResponse$QQData;
import com.huawei.appmarket.service.settings.view.widget.EnterLayout;
import o.cfw;
import o.cgz;
import o.BaseAlertDialog;
import o.BaseAlertDialog.a;
import o.cks;
import o.cvt;
import o.BaseRequest;
import o.der.f;
import o.dgm;
import o.Logger;
import o.drh;
import o.evx;

public class AboutQQGroupCard extends BaseAboutCard {
    private evx ˊ = new evx(this) {
        final /* synthetic */ AboutQQGroupCard ˏ;

        {
            this.ˏ = r1;
        }

        public void ˋ(View view) {
            this.ˏ.ॱ(this.ˏ.ˋ);
        }
    };
    private String ˋ = null;
    private EnterLayout ˎ;
    private BaseAlertDialog ˏ;

    class d implements IServerCallBack {
        final /* synthetic */ AboutQQGroupCard ˊ;

        private d(AboutQQGroupCard aboutQQGroupCard) {
            this.ˊ = aboutQQGroupCard;
        }

        public void prePostResult(BaseRequest o_cvu, ResponseBean responseBean) {
        }

        public void notifyResult(BaseRequest o_cvu, ResponseBean responseBean) {
            if ((responseBean instanceof GeneralResponse) && responseBean.getResponseCode() == 0) {
                GeneralResponse generalResponse = (GeneralResponse) responseBean;
                if (generalResponse.ˋ() != null && generalResponse.ˋ().ॱ() != null && generalResponse.ˋ().ॱ().size() > 0 && generalResponse.ˋ().ॱ().get(0) != null) {
                    CharSequence ˊ = ((GeneralResponse$QQData) generalResponse.ˋ().ॱ().get(0)).ˊ();
                    this.ˊ.ˋ = ((GeneralResponse$QQData) generalResponse.ˋ().ॱ().get(0)).ˏ();
                    if (!TextUtils.isEmpty(ˊ)) {
                        this.ˊ.ˎ.setMemo(ˊ);
                    }
                }
            }
        }
    }

    public AboutQQGroupCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        super.ˏ(view);
        this.ˎ = (EnterLayout) view.findViewById(o.der.d.ˌॱ);
        this.ˎ.setTitle(Integer.valueOf(f.ˊ));
        this.ˎ.setMemo(Integer.valueOf(f.ᐝ));
        this.ˎ.setOnClickListener(this.ˊ);
        ˊ();
        return this;
    }

    private void ˊ() {
        cvt o_drh = new drh("qq");
        o_drh.setServiceType_(dgm.ˎ((Activity) this.ˎ.getContext()));
        cfw.ˎ(o_drh, new d());
    }

    private void ॱ(String str) {
        if (!ˏ("com.tencent.mobileqq")) {
            ˋ();
        } else if (TextUtils.isEmpty(str)) {
            Logger.e("AboutQQGroupCard", "go QQ Group error: key is empty");
            ˊ(ˎ() + "/redirect/qqgroup");
        } else {
            Intent intent = new Intent();
            intent.setData(Uri.parse(str));
            try {
                this.ˎ.getContext().startActivity(intent);
            } catch (Exception e) {
                Logger.e("AboutQQGroupCard", "go QQ Group error: " + e.toString());
            }
        }
    }

    private void ˋ() {
        if (this.ˏ != null) {
            this.ˏ.ˏ();
            this.ˏ = null;
        }
        this.ˏ = BaseAlertDialog.ˋ(this.ᐝ, null, this.ᐝ.getString(f.ٴ));
        this.ˏ.ˎ(new cks(this) {
            final /* synthetic */ AboutQQGroupCard ॱ;

            {
                this.ॱ = r1;
            }

            public void enableNetworking() {
                this.ॱ.ˎ("com.tencent.mobileqq");
            }

            public void upgrade() {
            }

            public void ˋ() {
            }
        });
        this.ˏ.ॱ();
        this.ˏ.ॱ(a.ˋ, f.ˑॱ);
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
    }
}
